import request from '@/utils/request'


// 查询仓库列表
export function getWarehouse(query) {
  return request({
    url: '/basic/warehouse/',
    method: 'get',
    params: query
  })
}

// 查询仓库详情
export function getWarehouseDetail(query) {
  return request({
    url: '/basic/warehouse/'+query,
    method: 'get'
  })
}

// 删除仓库
export function delWarehouse(query) {
  return request({
    url: '/basic/warehouse/'+query,
    method: 'delete'
  })
}


// 新增仓库
export function addWarehouse(query) {
  return request({
    url: '/basic/warehouse/',
    method: 'post',
    data: query
  })
}

// 修改仓库
export function updateWarehouse(query) {
  return request({
    url: '/basic/warehouse/',
    method: 'put',
    data: query
  })
}

// 查询仓库select
export function getAllWarehouse(type) {
  return request({
    url: '/basic/warehouse/referFilter?type=' + type,
    method: 'get',
  })
}


//仓库绑定商品
export function bindingProduct(data) {
  return request({
    url: '/basic/warehouse/binding/product',
    method: 'post',
    data: data
  })
}


// 查询排除自己以外仓库
export function getOtherWarehouse(data) {
  return request({
    url: '/basic/warehouse/refer',
    method: 'get',
    params:data
  })
}

//矫正经纬度
export function updateAddress(data) {
  return request({
    url: '/basic/warehouse/update/address',
    method: 'put',
    params:data
  })
}
